% Basic Introduction:
% This functions constructs a 1D-grid with unevenly distributed points. The
% interval width is controlled as:
% Interval_{i+1}/Interval_{i}=exp(Grid_curvature)
% When Grid_curvature=0, the grid is evenly spaced;
% when Grid_curvature>0, more grid points are located close to the left
% end;
% when Grid_curvature<0, more grid points are located close to the right 
% end.
% Function Form:
% Grid=VecFun_MakeLogDiffGrid(Grid_min,Grid_max,Grid_num,Grid_curvature)

function Grid=VecFun_MakeLogDiffGrid(Grid_min,Grid_max,Grid_num,Grid_curvature)

if Grid_curvature==0
    Grid        =   linspace(Grid_min,Grid_max,Grid_num);
else
    unit        =   ( Grid_max-Grid_min )*( 1-exp(Grid_curvature) )/...
                    ( 1-exp( (Grid_num-1)*Grid_curvature ) );
    grid        =   unit*exp( Grid_curvature*(0:1:Grid_num-2) );
    Grid        =   [Grid_min,Grid_min+cumsum(grid,2)];
end
